<?php
namespace app\index\controller;

use app\index\model\UsersModel;
use app\index\model\ChangeModel;
use think\Exception;
use SeasLog;

class Users
{
    public function getUsersInfo()
    {
        $model = new UsersModel;
        // try {
        //     $result = $model->getInfo();
        // } catch (Exception $e) {
        //     $err = [
        //         'errorCode' => 1000,
        //         'message' => '获取 Info 失败!'
        //     ];
        //     return json($err);
        // }
        $result = $model->getInfo();

        return json($result);
    }

    public function seasLog()
    {
        echo SeasLog::getBasePath();
        // SeasLog::setLogger('Server');
        SeasLog::setLogger('Api');
        SeasLog::debug('it is debug');
    }

    public function change()
    {
        $model = new ChangeModel;
        // $result = $model->classchildren();
        $result = $model->projects();
        dump($result);
    }

    public function test()
    {
        // $model = new ChangeModel;
        // $result = $model->myTest();
        $result = ChangeModel::get(3)->myTest();
        dump($result);
    }
}